package cn.edu.sysu.service;

import java.util.HashMap;
import java.util.Map;

import com.sina.sae.memcached.SaeMemcache;

import cn.edu.sysu.dao.SolutionDao;
import cn.edu.sysu.dto.SolutionDto;
import cn.edu.sysu.util.Transaction;
import cn.edu.sysu.util.TransactionRead;

public class SolutionService {

	SolutionDao sDao = SolutionDao.INSTANCE;

	Transaction read = TransactionRead.INSTANCE;



	public Map<Integer, SolutionDto> getLatestSolutionByUser(int problem_id){

		System.out.println("getLatestSolutionByUser");

		Map<Integer, SolutionDto> map = sDao.getLatestSolution(read, problem_id);

		System.out.println(map.containsKey(1));

		return map;
	}


	public SolutionDto getSolution(int problemId, int userId, int revision){
		return sDao.getSolution(read, problemId, userId, revision);
	}
}
